<template>
    <div class="aboutRight">
        <ul v-if="!$route.params.id">
            <li v-for="item in newsList" :key="item.id" @click="handleClick(item.id)">
                <span>{{ item.title }}</span>
                <i>{{ item.time }}</i>
            </li>
        </ul>
        <router-view />
    </div>
</template>

<script>
export default {
    props: ['newsList'],
    data() {
        return {
            // newsList: [
            //     { id: 1, title: '酒店隔墙', time: '2017-04-18' },
            //     { id: 2, title: '江西铝材批发', time: '2017-04-18' },
            // ],
        };
    },
    methods: {
        handleClick(id) {
            this.$router.push('/about/newsDetail/' + id);
        },
    },
    components: {},
};
</script>

<style scoped lang="scss">
.aboutRight {
    ul {
        li {
            display: flex;
            justify-content: space-between;
            border-bottom: 1px dashed #ccc;
            span,
            i {
                display: block;
                padding: 10px 10px 5px 10px;
            }
        }
    }
}
</style>
